<?php
date_default_timezone_set ( 'PRC' );
header('Content-Type: text/html; charset=utf-8');

include 'config.php';

/* Connect to a MySQL server  连接数据库服务器 */
$link = mysqli_connect(
    $HOSTNAME,  /* The host to connect to 连接MySQL地址 */
    $USERNAME,      /* The user to connect as 连接MySQL用户名 */
    $PASSWORD,  /* The password to use 连接MySQL密码 */
    $DATABASE);    /* The default database to query 连接数据库名称*/

if (!$link) {
    printf("Can't connect to MySQL Server. Errorcode: %s ", mysqli_connect_error());
    exit;
}
mysqli_set_charset($link, "utf8");
$_SESSION['mysqli_link']=$link;